package com.frxuexi.lib_base

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.NavHostController

@Composable
fun BaseTitle(navHostController: NavHostController,title:String,btn:String="",modifier: Modifier=Modifier,onClick:()->Unit={}) {
    Row(modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween) {
        Icon(imageVector = Icons.Default.ArrowBack, contentDescription = "",
            Modifier.clickable {
                navHostController.popBackStack()
            })
        Text(text = title)
        Text(text = btn, modifier = Modifier.clickable { onClick() })
    }
}